FNP - Proof Systems - Halo2 Zero-Knowledge Circuits
Summary (Explain Like I’m 5)
Imagine you want to prove to a bank that you have $1000 in your account without showing them your bank statement (privacy). Halo2 does this magic using zero-knowledge proofs:- You create a “proof” (a mathematical certificate)
- Bank verifies the proof (without learning anything else)
- Bank is convinced you have $1000
- Bank learns nothing about how you got it
Technical Deep Dive
Halo2 is a zero-knowledge proof system using Inner Product Arguments (IPA) to achieve compact proofs (~514 bytes) with efficient verification. Three Properties of ZK Proofs (The “Triangle”):-
Completeness: Honest prover always generates valid proofs
-
Soundness: Dishonest prover can’t forge false proofs
-
Zero-Knowledge: Proof reveals nothing about witness
| Circuit | Purpose | Constraints | Proof Size |
|---|---|---|---|
| RangeCheckChip | Prove 0 ≤ x < 2^256 | ~300 | ~400 bytes |
| ComparisonChip | Prove a < b | ~2,800 | ~420 bytes |
| M2OREChip | Verify order-reveal | ~2,250 | ~450 bytes |
| KyberChip | Verify key encapsulation | ~3,000 | ~480 bytes |
| InsertProofCircuit | Full insert verification | ~51,350 | ~514 bytes |
| DeleteProofCircuit | Full delete verification | ~51,900 | ~528 bytes |
Mermaid Diagrams
Key Terms
- ZK Proof → Mathematical certificate proving statement truth without revealing witness
- Arithmetic Circuit → Constraints as polynomial equations over finite field
- IPA → Inner Product Argument; compact proof with O(log n) size and verification
- Commitment → Cryptographic binding to value; can’t change commitment without breaking security
- Witness → Secret data used to generate proof; must remain hidden
- Public Input → Known data; verifier already knows this
- Constraint System → Set of polynomial equations that must evaluate to zero
- Field Arithmetic → All operations mod p (BLS12-381 prime ≈ 2^255)
Q/A
Q: How does the prover prove something without revealing the witness? A: Prover commits to witness (using hash/Merkle tree), then opens specific points without revealing the full witness. Verifier checks that polynomial satisfies constraints at those points. Similar to proving “I know the answer to a puzzle” by solving only a few challenges without revealing full solution. Q: Why is proof size only 514 bytes for 51,350 constraints? A: IPA achieves O(log n) proof size through recursive folding. Instead of sending all 51,350 constraint openings, prover sends only ~16-17 group elements that collectively prove the entire circuit. Verifier reconstructs full constraint check from compact proof. Q: Can verifier cheat and accept false proofs? A: Soundness guarantees: if statement is false, dishonest prover needs to break a hard problem (discrete log, pairing security). Probability of forging accepting proof < 50% per attempt. Multiple proofs exponentially decreases forgery probability. Q: Does verifier need to know prover’s secrets to verify? A: No. Verifier has public input and proof. Verifier checks: (1) Polynomial constraints satisfied at point ζ, (2) Commitment opens to stated value, (3) IPA proof is valid. All done without access to witness or secret keys. Q: What happens if someone replays an old proof? A: Proofs are non-transferable if public input includes timestamp/nonce. FNP includes operation ID (hash of timestamp + position + content) in circuit witness. Same operation can’t be replayed: changing timestamp changes circuit input, invalidating old proof. Q: Why <15ms verification time on mobile? A: IPA verifier is O(log n) ≈ 16 pairings. Modern mobile CPU: ~1ms per pairing. 16 pairings × 1ms ≈ 16ms (within budget). Server-side verification with GPU: <1ms. Halo2 proof verification scales logarithmically with circuit size.Example / Analogy
Math Exam Analogy: Without ZK Proof:- Teacher: “Prove you know calculus”
- Student: Shows full exam work (everyone learns solution)
- Problem: Cheaters copy the work
- Teacher: “Prove you know calculus”
- Student: Generates cryptographic proof (no solution shown)
- Teacher verifies proof mathematically
- Teacher is convinced student knows calculus
- Cheaters can’t replicate proof without knowledge
Cross-References: System Overview, FNP Protocol Flow, M²-ORE Encryption, Kyber-1024 Category: Proof Systems | Cryptography | Zero-Knowledge | Security Difficulty: Advanced ⭐⭐⭐⭐⭐ Updated: 2025-11-28